# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         test03
# Description:
# Author:       98745
# Date:         2019/4/7
#-------------------------------------------------------------------------------

import re

code='6227 3333 4444 5555'
s='(\d{4}) \d{4} \d{4} \d{4}'
m=re.search(s,code)
print(m.group())
print(m.groups())
if m.group(1)=='6227' or m.group(1)=='4367':
    print('{}是建设银行的卡号'.format(code))
elif m.group(1)=='6221' or m.group(1)=='6210':
    print('{}是邮政银行的卡号'.format(code))
elif m.group(1)=='6228' or m.group(1)=='9559':
    print('{}是农业银行的卡号'.format(code))
else:
    print('{}是其他银行的卡号'.format(code))
